package com.yl.ydk.ui.adapter

import com.yl.ydk.R
import com.yl.ydk.bean.DiseaseCateBean
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder


class DiseaseDetailAdapter(data: MutableList<DiseaseCateBean.Symptom>?) :
    BaseQuickAdapter<DiseaseCateBean.Symptom, BaseViewHolder>(
        R.layout.item_disease_detail,
        data
    ) {


    override fun convert(helper: BaseViewHolder?, item: DiseaseCateBean.Symptom?) {

        helper?.let {
            it.setText(R.id.tvName, item?.name)
            it.itemView.setOnClickListener {
                onItemClick?.onListItemClick(item)
            }
        }
    }

    private var onItemClick: onListItemClick? = null

    interface onListItemClick {
        fun onListItemClick(item: DiseaseCateBean.Symptom?)
    }

    fun onListItemClick(onListItemClick: onListItemClick?) {
        this.onItemClick = onListItemClick
    }

}